package com.yunchen.BooksManagementSystem.utils;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @创建人
 * @创建时间
 * @描述
 */
public class DBUtil {
    public static final String url = "jdbc:mysql:///library";
    public static final String user = "root";
    public static final String password = "123456";
    public static Connection conn = null;
    static {
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            conn = DriverManager.getConnection(url,user,password);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static Connection getConnection(){
        return conn;
    }
}
